package com.mycat.alipay.test;

import com.alipay.api.response.AlipayTradeFastpayRefundQueryResponse;
import com.alipay.api.response.AlipayTradeRefundResponse;
import com.mycat.alipay.bizcontent.AppPaymentContent;
import com.mycat.alipay.bizcontent.RefundContent;
import com.mycat.alipay.bizcontent.RefundQueryContent;
import com.mycat.alipay.server.AliPaymentServer;
import com.mycat.alipay.server.AliRefundServer;
import com.mycat.entity.AlipayParam;
import com.mycat.exception.PaymentException;

/**
 * @desc 支付宝相关接口测试类，需要进行测试需要配置支付宝com.mycat.alipay.config.AlipayConfig相中关参数
 * @author roger
 * @date 2016年9月26日
 */
@SuppressWarnings("unused")
public class Main {

	public static void main(String[] args) {
		/***************支付宝APP支付请求参数****************/
		/*try {
			AppPaymentContent content = new AppPaymentContent();
			content.setOut_trade_no("20160921112139857443");
			content.setSubject("金逛阔自助海鲜烤肉");
			content.setBody("金逛阔自助海鲜烤肉");
			content.setTotal_amount("0.01");
			content.setProduct_code("alipayAPP");
			AlipayParam paymentParam = AliPaymentServer.getAlipayAppRequestParam(content);
			System.out.print(paymentParam.getAlipayStr());
		} catch (PaymentException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}*/
		/***************支付宝APP支付请求参数****************/
		
		
		/***************支付宝申请退款****************/
		/*try {
			RefundContent content = new RefundContent();
			content.setOut_trade_no("20160922154411208249");
			content.setRefund_amount("0.01");
			content.setOut_request_no("201609221544112082491111");

			AlipayTradeRefundResponse refundResponse;
			refundResponse = AliRefundServer.refund(content);
			System.out.println(refundResponse.getBody());
		} catch (Exception e) {
			e.printStackTrace();
		}*/
		/***************支付宝申请退款****************/

		
		/***************支付宝退款查查询****************/
		/*try {
			RefundQueryContent bizContent = new RefundQueryContent();
			bizContent.setOut_trade_no("20160922154411208249");
			bizContent.setOut_request_no("201609221544112082491111");
			AlipayTradeFastpayRefundQueryResponse response = AliRefundServer.refundQuery(bizContent);
			System.out.println(response);
		} catch (Exception e) {
			e.printStackTrace();
		}*/
		/***************支付宝退款查查询****************/

	}

}
